/*
 * SpellList.java
 *
 * Created on October 17, 2007, 4:16 PM
 */

package jia.editor.lists;

import jia.editor.EditorMain;
import jia.editor.forms.SpellEditor;
import jia.tools.PanelSwapper;

/**
 *
 * @author  estell
 */
public class pnl_SpellList extends javax.swing.JPanel {
    
    /** Creates new form SpellList */
    public pnl_SpellList() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        pop_SpellListContext = new javax.swing.JPopupMenu();
        mnu_popEdit = new javax.swing.JMenuItem();
        mnu_popDelete = new javax.swing.JMenuItem();
        sp_SpellListMain = new javax.swing.JSplitPane();
        scrl_SpellList = new javax.swing.JScrollPane();
        tbl_SpellList = new javax.swing.JTable();
        scrl_SpellListDetails = new javax.swing.JScrollPane();
        txt_SpellListDetails = new javax.swing.JTextArea();
        btn_SpellListCancel = new javax.swing.JButton();
        btn_SpellListAdd = new javax.swing.JButton();
        btn_SpellListEdit = new javax.swing.JButton();
        btn_SpellListDelete = new javax.swing.JButton();

        mnu_popEdit.setText("Item");
        pop_SpellListContext.add(mnu_popEdit);

        mnu_popDelete.setText("Item");
        pop_SpellListContext.add(mnu_popDelete);

        sp_SpellListMain.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1), java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("title_Spells"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.BELOW_TOP));
        sp_SpellListMain.setDividerLocation(400);
        sp_SpellListMain.setDividerSize(7);
        sp_SpellListMain.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        sp_SpellListMain.setOneTouchExpandable(true);
        sp_SpellListMain.setPreferredSize(new java.awt.Dimension(642, 558));
        tbl_SpellList.setComponentPopupMenu(pop_SpellListContext);
        tbl_SpellList.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Name", "Type", "Level", "Enabled"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Boolean.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        scrl_SpellList.setViewportView(tbl_SpellList);

        sp_SpellListMain.setTopComponent(scrl_SpellList);

        txt_SpellListDetails.setColumns(20);
        txt_SpellListDetails.setEditable(false);
        txt_SpellListDetails.setRows(5);
        scrl_SpellListDetails.setViewportView(txt_SpellListDetails);

        sp_SpellListMain.setRightComponent(scrl_SpellListDetails);

        btn_SpellListCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/door_out.png")));
        btn_SpellListCancel.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_SpellListCancel.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel"));
        btn_SpellListCancel.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_SpellListCancel.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_SpellListCancel.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_SpellListCancel.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_SpellListCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_SpellListCancelActionPerformed(evt);
            }
        });

        btn_SpellListCancel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_SpellListCancel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel"));

        btn_SpellListAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/add.png")));
        btn_SpellListAdd.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_SpellListAdd.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add"));
        btn_SpellListAdd.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_SpellListAdd.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_SpellListAdd.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_SpellListAdd.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_SpellListAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_SpellListAddActionPerformed(evt);
            }
        });

        btn_SpellListAdd.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_SpellListAdd.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add"));

        btn_SpellListEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/pencil.png")));
        btn_SpellListEdit.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_SpellListEdit.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit"));
        btn_SpellListEdit.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_SpellListEdit.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_SpellListEdit.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_SpellListEdit.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_SpellListEdit.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_SpellListEdit.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit"));

        btn_SpellListDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/delete.png")));
        btn_SpellListDelete.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_SpellListDelete.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete"));
        btn_SpellListDelete.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_SpellListDelete.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_SpellListDelete.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_SpellListDelete.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_SpellListDelete.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_SpellListDelete.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete"));

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(sp_SpellListMain, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, btn_SpellListEdit, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, btn_SpellListDelete, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, btn_SpellListCancel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(btn_SpellListAdd, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(sp_SpellListMain, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(layout.createSequentialGroup()
                        .add(19, 19, 19)
                        .add(btn_SpellListAdd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btn_SpellListEdit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btn_SpellListDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(btn_SpellListCancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btn_SpellListAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_SpellListAddActionPerformed
        PanelSwapper.swap(new SpellEditor(), this); 
    }//GEN-LAST:event_btn_SpellListAddActionPerformed

    private void btn_SpellListCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_SpellListCancelActionPerformed
        PanelSwapper.swap(EditorMain.p_defaultAdminPanel, this); 
    }//GEN-LAST:event_btn_SpellListCancelActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_SpellListAdd;
    private javax.swing.JButton btn_SpellListCancel;
    private javax.swing.JButton btn_SpellListDelete;
    private javax.swing.JButton btn_SpellListEdit;
    private javax.swing.JMenuItem mnu_popDelete;
    private javax.swing.JMenuItem mnu_popEdit;
    private javax.swing.JPopupMenu pop_SpellListContext;
    private javax.swing.JScrollPane scrl_SpellList;
    private javax.swing.JScrollPane scrl_SpellListDetails;
    private javax.swing.JSplitPane sp_SpellListMain;
    private javax.swing.JTable tbl_SpellList;
    private javax.swing.JTextArea txt_SpellListDetails;
    // End of variables declaration//GEN-END:variables
    
}
